/**
 * Patient.java
 *
 * @author Halbeisen Stephan
 *
 * 15.04.2011
 *
 */

package at.fhv.easyDietWeb.shared.db.masterData;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import at.fhv.easyDietWeb.shared.db.diet.PatientState;
import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * information: represents the table Patient on the database
 */
public class Patient implements IsSerializable
{
	private int _patientId;
	private Person _person;
	private String _insurancePolicyNumber;
	private String _insuranceCompany;
	private String _gender;
	private Date _dateOfBirth;
	private Date _firstContact;
	private Date _nextContact;
	private Person _recordedBy;
	private String _notes;
	private Date _creationDate;
	private PatientState _state;
	private String _placeOfBirth;
	private String _religion;
	private String _familyStatus;
	private List<Disease> _diseases = new ArrayList<Disease>();
	private List<Intolerance> _intolerances = new ArrayList<Intolerance>();

	public void setInsurancePolicyNumber(String insurancePolicyNumber)
	{
		_insurancePolicyNumber = insurancePolicyNumber;
	}

	public String getInsurancePolicyNumber()
	{
		return _insurancePolicyNumber;
	}

	public void setGender(String gender)
	{
		_gender = gender;
	}

	public String getGender()
	{
		return _gender;
	}

	public void setDateOfBirth(Date dateOfBirth)
	{
		_dateOfBirth = dateOfBirth;
	}

	public Date getDateOfBirth()
	{
		return _dateOfBirth;
	}

	public void setFirstContact(Date firstContact)
	{
		_firstContact = firstContact;
	}

	public Date getFirstContact()
	{
		return _firstContact;
	}

	public void setNextContact(Date nextContact)
	{
		_nextContact = nextContact;
	}

	public Date getNextContact()
	{
		return _nextContact;
	}

	public void setNotes(String notes)
	{
		_notes = notes;
	}

	public String getNotes()
	{
		return _notes;
	}

	public void setCreationDate(Date creationDate)
	{
		_creationDate = creationDate;
	}

	public Date getCreationDate()
	{
		return _creationDate;
	}

	public void setState(PatientState state)
	{
		_state = state;
	}

	public PatientState getState()
	{
		return _state;
	}

	private void setPatientId(int patientId)
	{
		_patientId = patientId;
	}

	public int getPatientId()
	{
		return _patientId;
	}

	public void setPerson(Person person)
	{
		_person = person;
	}

	public Person getPerson()
	{
		return _person;
	}

	public void setRecordedBy(Person recordedBy)
	{
		_recordedBy = recordedBy;
	}

	public Person getRecordedBy()
	{
		return _recordedBy;
	}

	public void setFirstName(String firstName)
	{
		_person.setFirstName(firstName);
	}

	public String getFirstName()
	{
		return _person.getFirstName();
	}

	public void setLastName(String lastName)
	{
		_person.setLastName(lastName);
	}

	public String getLastName()
	{
		return _person.getLastName();
	}

	public void setTitle(String title)
	{
		_person.setTitle(title);
	}

	public String getTitle()
	{
		return _person.getTitle();
	}

	public void setMailAddress(String mailAddress)
	{
		_person.setMailAddress(mailAddress);
	}

	public String getMailAddress()
	{
		return _person.getMailAddress();
	}

	public void setPhoneNumber(String phoneNumber)
	{
		_person.setPhoneNumber(phoneNumber);
	}

	public String getPhoneNumber()
	{
		return _person.getPhoneNumber();
	}

	public void setFaxNumber(String faxNumber)
	{
		_person.setFaxNumber(faxNumber);
	}

	public String getFaxNumber()
	{
		return _person.getFaxNumber();
	}

	public void setStreet(String street)
	{
		_person.getAddress().setStreet(street);
	}

	public String getStreet()
	{
		return _person.getAddress().getStreet();
	}

	public void setHouseNumer(String houseNumber)
	{
		_person.getAddress().setHouseNumber(houseNumber);
	}

	public String getHouseNumber()
	{
		return _person.getAddress().getHouseNumber();
	}

	public void setStairwayNumber(String stairwayNumber)
	{
		_person.getAddress().setStairwayNumber(stairwayNumber);
	}

	public String getStairwayNumber()
	{
		return _person.getAddress().getStairwayNumber();
	}

	public void setPostalCode(String postalCode)
	{
		_person.getAddress().setPostalCode(postalCode);
	}

	public String getPostalCode()
	{
		return _person.getAddress().getPostalCode();
	}

	public void setCity(String city)
	{
		_person.getAddress().setCity(city);
	}

	public String getCity()
	{
		return _person.getAddress().getCity();
	}

	public String getCountry()
	{
		return _person.getAddress().getCountry().getCountryId();
	}

	public void setPlaceOfBirth(String placeOfBirth)
	{
		_placeOfBirth = placeOfBirth;
	}

	public String getPlaceOfBirth()
	{
		return _placeOfBirth;
	}

	public void setInsuranceCompany(String insuranceCompany)
	{
		_insuranceCompany = insuranceCompany;
	}

	public String getInsuranceCompany()
	{
		return _insuranceCompany;
	}

	public String getNationality()
	{
		return _person.getNationality().getDescription();
	}

	public String getSalutation()
	{
		if (_gender.equalsIgnoreCase("M"))
		{
			return "Herr";
		} else if (_gender.equalsIgnoreCase("W"))
		{
			return "Frau";
		} else
		{
			return null;
		}
	}

	public void setReligion(String religion)
	{
		_religion = religion;
	}

	public String getReligion()
	{
		return _religion;
	}

	public void setFamilyStatus(String familyStatus)
	{
		_familyStatus = familyStatus;
	}

	public String getFamilyStatus()
	{
		return _familyStatus;
	}

	public void setDiseases(List<Disease> diseases)
	{
		_diseases = diseases;
	}

	public List<Disease> getDiseases()
	{
		return _diseases;
	}

	public void setIntolerances(List<Intolerance> intolerances)
	{
		_intolerances = intolerances;
	}

	public List<Intolerance> getIntolerances()
	{
		return _intolerances;
	}
}
